#include "RBF.h"

#include "../Utils/RandomUtil.h"

RBF::RBF(int inputDimension, int K, int outputDimension, shared_ptr<IKernelFunctionBase> kernelFunc, double imin, double imax)
{
	//auto randVectors = RandomUtil::CreateRandomVector(inputDimension, K, imin, imax);

	//for (int i = 0; i < K; i++)
	//{
	//	auto neuron = make_shared<CKMeansNeuron>(inputDimension, kernelFunc);
	//	neuron->InsertMeansPosition(randVectors[i]);

	//	m_KMeansNeurons.push_back(neuron);
	//}
	//
	//for (int i = 0; i < outputDimension; i++)
	//{
	//	m_RLSNeuron.push_back( make_shared<CRLSNeuron>(K, 1.0) );
	//}
}

bool RBF::Save(const char * szFileName)
{
	return true;
}

bool RBF::Load(const char * szFileName)
{
	return true;
}

Vector RBF::Execute(Vector InputData)
{
	int K = this->m_KMeansNeurons.size();

	Vector FAI(K);

	for (int i = 0; i < K; i++)
	{
		FAI[i] = this->m_KMeansNeurons[i]->Execute(InputData);
	}

	int osize = this->m_RLSNeuron.size();

	Vector result(osize);

	for (int i = 0; i < osize; i++)
	{
		result[i] = this->m_RLSNeuron[i]->Execute(FAI);
	}

	return result;
}